//
//  JHJobTypeTableViewCell.m
//  Job
//
//  Created by 桑赐相 on 2018/8/23.
//  Copyright © 2018年 桑赐相. All rights reserved.
//

#import "JHJobTypeTableViewCell.h"
#import "JHJobTypeModel.h"
@interface JHJobTypeTableViewCell()

@property (nonatomic,strong) UILabel *typeLabel;

@end
@implementation JHJobTypeTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubView];
    }
    return self;
}

-(void)initSubView{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.typeLabel = [UILabel new];
    self.typeLabel.textColor = MainTextColor;
    self.typeLabel.font = Font16;
    [self.contentView addSubview:self.typeLabel];
    
    [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.centerY.equalTo(self.contentView);
    }];
}


-(void)setModel:(JHJobTypeModel *)model{
    _model = model;
    self.typeLabel.text = model.text;
    if (model.selected) {
        self.contentView.backgroundColor = BaseThemeColor;
        self.typeLabel.textColor = [UIColor whiteColor];
    }else{
        self.typeLabel.textColor = MainTextColor;
        self.contentView.backgroundColor = ViewBackgroundColor;
    }
}

@end
